﻿using AbpAPI;
using Volo.Abp;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.Autofac;
using Volo.Abp.Http.Client;
using Volo.Abp.Modularity;

namespace AbpAPIWeb2
{
    [DependsOn(typeof(AbpAPIApplicationContractModule))]
    [DependsOn(typeof(AbpAspNetCoreMvcModule))]
    [DependsOn(typeof(AbpAutofacModule))]
    [DependsOn(typeof(AbpHttpClientModule))] //添加依赖
    public class AbpAPIWeb2Module : AbpModule
    {
        public override void ConfigureServices(ServiceConfigurationContext context)
        {
            base.ConfigureServices(context);

            //创建动态客户端代理
            context.Services.AddHttpClientProxies(
                typeof(AbpAPIApplicationContractModule).Assembly
            );

        }

        public override void OnApplicationInitialization(ApplicationInitializationContext context)
        {
            
            var app = context.GetApplicationBuilder();
        
            base.OnApplicationInitialization(context);
        }
    }
}
